docs: Reorder compiler command line for new GCC
authorDavid King <amigadave@amigadave.com>
Tue, 13 Nov 2012 14:13:32 +0000 (14:13 +0000)
committerDavid King <amigadave@amigadave.com>
Mon, 29 Apr 2013 06:31:16 +0000 (07:31 +0100)
Newer versions of GCC/binutils must have the source file come before the
preprocessor and linker flags on the compiler command line, and this is
also compatible with previous versions.

https://bugzilla.gnome.org/show_bug.cgi?id=680241

docs/reference/gtk/compiling.sgml

index 012cb70edab802e4b64e4eddde2f441bc32ed105..f61460c6d1993b10e51da5cf1fcd15442effa782 100644 (file)
@@ -42,7 +42,7 @@ feature of the shell. If you enclose a command in backticks
 substituted into the command line before execution. So to compile
 a GTK+ Hello, World, you would type the following:
 <programlisting>
-$ cc `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
+$ cc `pkg-config --cflags gtk+-3.0` hello.c -o hello `pkg-config --libs gtk+-3.0`
 </programlisting>
 </para>
 
@@ -67,7 +67,7 @@ this range will trigger compiler warnings.
 Here is how you would compile hello.c if you want to allow it
 to use symbols that were not deprecated in 3.2:
 <programlisting>
-$ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
+$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-3.0`
 </programlisting>
 </para>
 
@@ -75,7 +75,7 @@ $ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+
 And here is how you would compile hello.c if you don't want
 it to use any symbols that were introduced after 3.4:
 <programlisting>
-$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
+$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-3.0`
 </programlisting>
 </para>